-- 0 Database name, 1 Application user name, 2 Application user password
-- 3 Service user name, 4 Service user password, 5 If machine is local must be '-- ', else empty
delete from mysql.user where (user='{1}' or user='{3}');

grant create temporary tables, select, update, insert, delete on {0}.* to '{1}'@'localhost' identified by '{2}';
grant all privileges on {0}.* to '{3}'@'localhost' identified by '{4}';

{5}grant create temporary tables, select, update, insert, delete on {0}.* to '{1}'@'%' identified by '{2}';
{5}grant all privileges on {0}.* to '{3}'@'%' identified by '{4}';

flush privileges;